
local mt = ac.skill['散射']
mt.distance = 2000
mt.missile_art = [[91cd48b971932edfc649d155403740e0.mdx]]
mt.missile_speed = 900
mt.targettype = '点'
mt.range = 1200

function mt:on_cast_shot()
    local hero = self.owner
    local target = self.target
    local point1 = hero:get_point()
    local point2 = target:get_point()
    local angle = point1/point2 + 60
    local num = 0
    hero:set_animation_speed(5)
    hero:add_effect([[9753276ca38a709ee315c35f23214d61.mdl]],'chest',1)
    ac.loop(200,function(t)
        num = num + 1
        local angle = angle - 10*num
        point1:effect{
            model = [[fdcd174428a0c65293cd271ce959629e.mdx]],
            height = 90,
            angle = angle,
            time = 1.5,
        }
        hero:add_restriction '硬直'
        ac.wait(500,function()
            hero:remove_restriction '硬直'
            if hero:is_alive() and num<12 then
                hero:set_facing(angle,1)
                hero:play_animation('attack')
                ac.wait(200,function()
                    local damage = hero:get('攻击') * self.data1 / 100
                    local mover = hero:launch_wave(self.missile_art,angle,900,1200,nil,90)
                    local track = hero:track_select(mover,150,mover.distance/mover.speed,function(u)
                        hero:create_damage(u,damage,self)
                    end)
                end)
            else
                hero:set_animation_speed(1)
                hero:issue_order('attack',ac.enemy.base)
                t:remove()
            end
        end)
    end)
end

